<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.thymeleaf.org/thymeleaf-extras-shiro">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>首页</h1>
<div>
    <h2 th:text="${msg}"></h2>
    <div th:if="${session.loginUser==null}">
    <a th:href="@{/tologin}">登录</a>
    </div>
    <div th:if="${session.loginUser!=null}">
        <a th:href="@{/logout}">注销</a>
    </div>
</div>
<div>
    <shiro:hasPermission name="user:add">
        <a href="/user/add">add</a>
    </shiro:hasPermission>
</div>
<div>
    <shiro:hasPermission name="user:update">
    <a th:href="@{/user/update}">update</a>
    </shiro:hasPermission>
</div>
</body>
</html>